package com.dao;
 
import java.util.HashMap;
import java.util.Map;
 
import com.model.User;
 
public class UserDAO extends GenericDAO<User> {
 
	private static final long serialVersionUID = 1L;

	public UserDAO() {
        super(User.class);
    }
 
    public User findUserByUsernamePassword(String username, String password){
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("username", username);
        parameters.put("password", password);
 
        return super.findOneResult(User.FIND_BY_USERNAME_PASSWORD, parameters);
    }
    
    public User findUserByUsername(String username){
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("username", username);
 
        return super.findOneResult(User.FIND_BY_USERNAME, parameters);
    }
    
    public User find(int id){
    	return super.find(id);
    }
}